package equipement;

import java.util.ArrayList;

public class Degat {
	private int nbDe;
	private int de;
	private int bonusDegats;
	private int critique;
	private int modCritique;
	private ArrayList<Integer> nbDeSup;
	private ArrayList<Integer> deSup;
	private ArrayList<String> typeSup;
	

	public Degat(int nbDe, int de, int bonusDegats, int critique, int modCritique){
		this.nbDe = nbDe;
		this.de = de;
		this.bonusDegats = bonusDegats;
		this.critique = critique;
		this.modCritique = modCritique;
		this.nbDeSup = new ArrayList<Integer>();
		this.deSup = new ArrayList<Integer>();
		this.typeSup = new ArrayList<String>();
	}
	
	public void AddDegatDe(int nbDeSup, int deSup, String typeSup){
		
		this.nbDeSup.add(nbDeSup);
		this.deSup.add(deSup);
		this.typeSup.add(typeSup);
	}
	
	public void AddDegatFixe (int degatSup)
	{
		this.bonusDegats += degatSup;
	}
	
	@Override
	public String toString() {
		int i;
		
		String res = this.nbDe + "d" + this.de + "+" + this.bonusDegats + " ";
		
		if(!(this.nbDeSup.isEmpty()))
		{
			for(i=0; i<this.nbDeSup.size() ; i++)
				res = res + "+" + this.nbDeSup.get(i) + "d" + this.deSup.get(i) + "(" + 
						this.typeSup.get(i) + ") ";	
		}
		
		res = res + "CC:(";
		if(this.critique != 20)
			res = res + this.critique + "-";
		res = res+"20)x" + this.modCritique + "";
		
		return res;
	}
}
